//
//  FreeCtrlCom.m
//  Jyxt
//
//  Created by 刘日 on 17/5/18.
//  Copyright © 2017年 DaLian Rental Housing Management. All rights reserved.
//

#import "FreeCtrlCom.h"
#import "PriLKFreeCtrl.h"
#import "LMGlobalConfig.h"

@implementation FreeCtrlCom

- (void)open: (NSDictionary *)data{
    if ([data[@"type"] integerValue] == 0) {
        // 打开URL
        UIViewController *mixVc = [[LMGlobalConfig defaultConfig].mixViewControllerClass new];
        [mixVc setValue: data[@"url"] forKey: @"url"];
        [PriLKFreeCtrl pushViewController: mixVc];
    }
}

- (void)close: (NSDictionary *)data{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)([data[@"delay"] integerValue] * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [PriLKFreeCtrl popViewController];
    });
}

@end
